package cn.hahah.module.blog.dal.mysql.userhistorylogin;

import java.util.*;

import cn.hahah.framework.common.pojo.PageResult;
import cn.hahah.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.hahah.framework.mybatis.core.mapper.BaseMapperX;
import cn.hahah.module.blog.dal.dataobject.userhistorylogin.UserHistoryLoginDO;
import org.apache.ibatis.annotations.Mapper;
import cn.hahah.module.blog.controller.admin.userhistorylogin.vo.*;

/**
 * 用户登录记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserHistoryLoginMapper extends BaseMapperX<UserHistoryLoginDO> {

    default PageResult<UserHistoryLoginDO> selectPage(UserHistoryLoginPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserHistoryLoginDO>()
                .eqIfPresent(UserHistoryLoginDO::getUserId, reqVO.getUserId())
                .betweenIfPresent(UserHistoryLoginDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserHistoryLoginDO::getId));
    }

}